\(\int \frac {1}{(1-x) \sqrt {-4+2 x+x^2}} \, dx\) [2404]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [A] (verified)
   Fricas [A] (verification not implemented)
   Sympy [F]
   Maxima [A] (verification not implemented)
   Giac [A] (verification not implemented)
   Mupad [F(-1)]

Optimal result

Integrand size = 20, antiderivative size = 19 \[ \int \frac {1}{(1-x) \sqrt {-4+2 x+x^2}} \, dx=\arctan \left (\frac {3-2 x}{\sqrt {-4+2 x+x^2}}\right ) \]

[Out]

arctan((3-2*x)/(x^2+2*x-4)^(1/2))

Rubi [A] (verified)

Time = 0.01 (sec) , antiderivative size = 19, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.100, Rules used = {738, 210} \[ \int \frac {1}{(1-x) \sqrt {-4+2 x+x^2}} \, dx=\arctan \left (\frac {3-2 x}{\sqrt {x^2+2 x-4}}\right ) \]

[In]

Int[1/((1 - x)*Sqrt[-4 + 2*x + x^2]),x]

[Out]

ArcTan[(3 - 2*x)/Sqrt[-4 + 2*x + x^2]]

Rule 210

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(-(Rt[-a, 2]*Rt[-b, 2])^(-1))*ArcTan[Rt[-b, 2]*(x/Rt[-a, 2])
], x] /; FreeQ[{a, b}, x] && PosQ[a/b] && (LtQ[a, 0] || LtQ[b, 0])

Rule 738

Int[1/(((d_.) + (e_.)*(x_))*Sqrt[(a_.) + (b_.)*(x_) + (c_.)*(x_)^2]), x_Symbol] :> Dist[-2, Subst[Int[1/(4*c*d
^2 - 4*b*d*e + 4*a*e^2 - x^2), x], x, (2*a*e - b*d - (2*c*d - b*e)*x)/Sqrt[a + b*x + c*x^2]], x] /; FreeQ[{a,
b, c, d, e}, x] && NeQ[b^2 - 4*a*c, 0] && NeQ[2*c*d - b*e, 0]

Rubi steps \begin{align*} \text {integral}& = -\left (2 \text {Subst}\left (\int \frac {1}{-4-x^2} \, dx,x,\frac {6-4 x}{\sqrt {-4+2 x+x^2}}\right )\right ) \\ & = \tan ^{-1}\left (\frac {3-2 x}{\sqrt {-4+2 x+x^2}}\right ) \\ \end{align*}

Mathematica [A] (verified)

Time = 0.07 (sec) , antiderivative size = 20, normalized size of antiderivative = 1.05 \[ \int \frac {1}{(1-x) \sqrt {-4+2 x+x^2}} \, dx=-2 \arctan \left (1-x+\sqrt {-4+2 x+x^2}\right ) \]

[In]

Integrate[1/((1 - x)*Sqrt[-4 + 2*x + x^2]),x]

[Out]

-2*ArcTan[1 - x + Sqrt[-4 + 2*x + x^2]]

Maple [A] (verified)

Time = 0.28 (sec) , antiderivative size = 23, normalized size of antiderivative = 1.21

method result size
default \(-\arctan \left (\frac {-6+4 x}{2 \sqrt {\left (-1+x \right )^{2}-5+4 x}}\right )\) \(23\)
trager \(\operatorname {RootOf}\left (\textit {\_Z}^{2}+1\right ) \ln \left (-\frac {2 \operatorname {RootOf}\left (\textit {\_Z}^{2}+1\right ) x +\sqrt {x^{2}+2 x -4}-3 \operatorname {RootOf}\left (\textit {\_Z}^{2}+1\right )}{-1+x}\right )\) \(44\)

[In]

int(1/(1-x)/(x^2+2*x-4)^(1/2),x,method=_RETURNVERBOSE)

[Out]

-arctan(1/2*(-6+4*x)/((-1+x)^2-5+4*x)^(1/2))

Fricas [A] (verification not implemented)

none

Time = 0.37 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.95 \[ \int \frac {1}{(1-x) \sqrt {-4+2 x+x^2}} \, dx=-2 \, \arctan \left (-x + \sqrt {x^{2} + 2 \, x - 4} + 1\right ) \]

[In]

integrate(1/(1-x)/(x^2+2*x-4)^(1/2),x, algorithm="fricas")

[Out]

-2*arctan(-x + sqrt(x^2 + 2*x - 4) + 1)

Sympy [F]

\[ \int \frac {1}{(1-x) \sqrt {-4+2 x+x^2}} \, dx=- \int \frac {1}{x \sqrt {x^{2} + 2 x - 4} - \sqrt {x^{2} + 2 x - 4}}\, dx \]

[In]

integrate(1/(1-x)/(x**2+2*x-4)**(1/2),x)

[Out]

-Integral(1/(x*sqrt(x**2 + 2*x - 4) - sqrt(x**2 + 2*x - 4)), x)

Maxima [A] (verification not implemented)

none

Time = 0.29 (sec) , antiderivative size = 27, normalized size of antiderivative = 1.42 \[ \int \frac {1}{(1-x) \sqrt {-4+2 x+x^2}} \, dx=-\arcsin \left (\frac {2 \, \sqrt {5} x}{5 \, {\left | x - 1 \right |}} - \frac {3 \, \sqrt {5}}{5 \, {\left | x - 1 \right |}}\right ) \]

[In]

integrate(1/(1-x)/(x^2+2*x-4)^(1/2),x, algorithm="maxima")

[Out]

-arcsin(2/5*sqrt(5)*x/abs(x - 1) - 3/5*sqrt(5)/abs(x - 1))

Giac [A] (verification not implemented)

none

Time = 0.26 (sec) , antiderivative size = 18, normalized size of antiderivative = 0.95 \[ \int \frac {1}{(1-x) \sqrt {-4+2 x+x^2}} \, dx=-2 \, \arctan \left (-x + \sqrt {x^{2} + 2 \, x - 4} + 1\right ) \]

[In]

integrate(1/(1-x)/(x^2+2*x-4)^(1/2),x, algorithm="giac")

[Out]

-2*arctan(-x + sqrt(x^2 + 2*x - 4) + 1)

Mupad [F(-1)]

Timed out. \[ \int \frac {1}{(1-x) \sqrt {-4+2 x+x^2}} \, dx=-\int \frac {1}{\left (x-1\right )\,\sqrt {x^2+2\,x-4}} \,d x \]

[In]

int(-1/((x - 1)*(2*x + x^2 - 4)^(1/2)),x)

[Out]

-int(1/((x - 1)*(2*x + x^2 - 4)^(1/2)), x)